package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.BusiMplstpConstraintMapper;
import com.ruoyi.net.domain.BusiMplstpConstraint;
import com.ruoyi.net.service.IBusiMplstpConstraintService;

/**
 * 业务-mplstp-路由约束配置Service业务层处理
 * 
 * @author net
 * @date 2024-11-27
 */
@Service
public class BusiMplstpConstraintServiceImpl implements IBusiMplstpConstraintService 
{
    @Autowired
    private BusiMplstpConstraintMapper busiMplstpConstraintMapper;

    /**
     * 查询业务-mplstp-路由约束配置
     * 
     * @param id 业务-mplstp-路由约束配置主键
     * @return 业务-mplstp-路由约束配置
     */
    @Override
    public BusiMplstpConstraint selectBusiMplstpConstraintById(String id)
    {
        return busiMplstpConstraintMapper.selectBusiMplstpConstraintById(id);
    }

    /**
     * 查询业务-mplstp-路由约束配置列表
     * 
     * @param busiMplstpConstraint 业务-mplstp-路由约束配置
     * @return 业务-mplstp-路由约束配置
     */
    @Override
    public List<BusiMplstpConstraint> selectBusiMplstpConstraintList(BusiMplstpConstraint busiMplstpConstraint)
    {
        return busiMplstpConstraintMapper.selectBusiMplstpConstraintList(busiMplstpConstraint);
    }

    /**
     * 新增业务-mplstp-路由约束配置
     * 
     * @param busiMplstpConstraint 业务-mplstp-路由约束配置
     * @return 结果
     */
    @Override
    public int insertBusiMplstpConstraint(BusiMplstpConstraint busiMplstpConstraint)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(busiMplstpConstraint.getId())) {
            busiMplstpConstraint.setId(uuid);
        }
        busiMplstpConstraint.setCreateBy(SecurityUtils.getUsername());
        busiMplstpConstraint.setCreateTime(DateUtils.getNowDate());
        busiMplstpConstraint.setUpdateBy(SecurityUtils.getUsername());
        busiMplstpConstraint.setUpdateTime(DateUtils.getNowDate());
        return busiMplstpConstraintMapper.insertBusiMplstpConstraint(busiMplstpConstraint);
    }

    /**
     * 修改业务-mplstp-路由约束配置
     * 
     * @param busiMplstpConstraint 业务-mplstp-路由约束配置
     * @return 结果
     */
    @Override
    public int updateBusiMplstpConstraint(BusiMplstpConstraint busiMplstpConstraint)
    {
        busiMplstpConstraint.setUpdateBy(SecurityUtils.getUsername());
        busiMplstpConstraint.setUpdateTime(DateUtils.getNowDate());
        return busiMplstpConstraintMapper.updateBusiMplstpConstraint(busiMplstpConstraint);
    }

    /**
     * 批量删除业务-mplstp-路由约束配置
     * 
     * @param ids 需要删除的业务-mplstp-路由约束配置主键
     * @return 结果
     */
    @Override
    public int deleteBusiMplstpConstraintByIds(String[] ids)
    {
        return busiMplstpConstraintMapper.deleteBusiMplstpConstraintByIds(ids);
    }

    /**
     * 删除业务-mplstp-路由约束配置信息
     * 
     * @param id 业务-mplstp-路由约束配置主键
     * @return 结果
     */
    @Override
    public int deleteBusiMplstpConstraintById(String id)
    {
        return busiMplstpConstraintMapper.deleteBusiMplstpConstraintById(id);
    }
}
